package vista;

import java.awt.BorderLayout;
import java.awt.Frame;
import javax.swing.WindowConstants;
import javabean.JPanelImagen;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import controlador.ControladorMenu;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
@SuppressWarnings("serial")
public class VistaMenu extends javax.swing.JFrame {

	JPanelImagen panelFondo;
	private JMenu menuinfo;
	private JMenuItem menuConsultar;
	private JMenuItem menuFrases;
	private JMenuItem menuJugar;
	private JMenu Juego;
	private JMenuBar menu;
	
	
	

	public JMenu getMenuinfo() {
		return menuinfo;
	}

	public void setMenuinfo(JMenu menuinfo) {
		this.menuinfo = menuinfo;
	}

	public JMenuItem getMenuConsultar() {
		return menuConsultar;
	}

	public void setMenuConsultar(JMenuItem menuconsultar) {
		this.menuConsultar = menuconsultar;
	}

	public JMenuItem getMenuFrases() {
		return menuFrases;
	}

	public void setMenuFrases(JMenuItem menufrases) {
		this.menuFrases = menufrases;
	}

	public JMenuItem getMenuJugar() {
		return menuJugar;
	}

	public void setMenuJugar(JMenuItem menujugar) {
		this.menuJugar = menujugar;
	}

		
	public VistaMenu() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setExtendedState(Frame.MAXIMIZED_HORIZ);
			{
				menu = new JMenuBar();
				setJMenuBar(menu);
				{
					Juego = new JMenu();
					menu.add(Juego);
					Juego.setText("Juego");
					{
						menuJugar = new JMenuItem();
						Juego.add(menuJugar);
						menuJugar.setText("Jugar");
					}
					{
						menuFrases = new JMenuItem();
						Juego.add(menuFrases);
						menuFrases.setText("Frases");
					}
				}
				{
					menuinfo = new JMenu();
					menu.add(menuinfo);
					menuinfo.setText("Informacion");
					{
						menuConsultar = new JMenuItem();
						menuinfo.add(menuConsultar);
						menuConsultar.setText("Consultar");
					}
				}
			}

			{
				panelFondo = new JPanelImagen();
				getContentPane().add(panelFondo, BorderLayout.CENTER);
				//panelFondo.setRutaImagen("../imagenfondo.png");
				//panelFondo.setRutaImagen("../ahorcado3.jpg");
				panelFondo.setRutaImagen("/imagenes/ahorcadoPrincipal.jpg");
				
				panelFondo.setPreferredSize(new java.awt.Dimension(569, 408));
				panelFondo.setEnabled(false);
			}
			
			registrarControlador();
			pack();
			this.setSize(671, 413);
			this.setVisible(true);
			this.setLocationRelativeTo(null);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	public void registrarControlador(){
			
			ControladorMenu controlador = new ControladorMenu(this);
			menuJugar.addActionListener(controlador);
			menuFrases.addActionListener(controlador);
			menuConsultar.addActionListener(controlador);
		}


}
